package factory.simple;

import factory.method.Product1;
import factory.method.Product2;

public class SimpleFactory {
	public Object create(Class<?> clazz) {
		if (clazz.getName().equals(Product1.class.getName())) {
			return createProduct1();
		} else if (clazz.getName().equals(Product2.class.getName())) {
			return createProduct2();
		}

		return null;
	}

	private Product1 createProduct1() {
		return new Product1();
	}

	private Product2 createProduct2() {
		return new Product2();
	}
}
